package com.ytjj.qmyx.admin.service.imService.impl;

import com.github.pagehelper.PageHelper;
import com.ytjj.common.api.CommonPage;
import com.ytjj.common.service.RedisService;
import com.ytjj.qmyx.admin.mapper.ImKeywordsMapper;
import com.ytjj.qmyx.admin.model.ImKeywords;
import com.ytjj.qmyx.admin.model.ImKeywordsExample;
import com.ytjj.qmyx.admin.service.imService.ImKeywordsService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ytjj.qmyx.admin.service.imService.ImKeywordsService;

import java.util.List;


@Service
@Slf4j
public class ImKeywordsServiceImpl implements ImKeywordsService {

    @Autowired
    private ImKeywordsMapper imKeywordsMapper;
    @Autowired
    private RedisService redisService;

    @Override
    public CommonPage findList(ImKeywords imKeywords) {
        PageHelper.startPage(imKeywords.getPageNum(),imKeywords.getPageSize());
        List<ImKeywords> list = imKeywordsMapper.findList(imKeywords);
        return CommonPage.restPage(list);
    }

    @Override
    public void add(ImKeywords imKeywords) {
        imKeywordsMapper.insertSelective(imKeywords);
    }

    @Override
    public void update(ImKeywords imKeywords) {
        imKeywordsMapper.updateByPrimaryKeySelective(imKeywords);
    }

    @Override
    public void delete(Integer id) {
        imKeywordsMapper.deleteByPrimaryKey(id);
    }
}
